<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Koa-demo</title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			#Express-demo{
				width: 500px;
				margin: 100px auto;
			}
			#email{
				width: 200px;
				height: 30px;
				border-radius: 4px;
				border: 1px solid #58bc58;
				box-shadow: 0 0 5px #58bc58;
				padding-left: 5px;
			}
			.send_btn{
				width: 60px;
				height: 30px;
				border-radius: 4px;
				background-color: #58BC58;
				color: #fff;
				box-shadow: 0 0 5px #58bc58;
			}
		</style>
	</head>
	<body>
		<div id="Express-demo">
			<input type="email" name="" id="email" placeholder="请输入您的邮箱" value="" />
			<button type="button" class="send_btn">按钮</button>
		</div>
		<script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(".send_btn").click(() => {
				if($("#email").val()){
					$.ajax({
						type: "POST",
						url: "http://192.168.0.102:3002/email",
						data: {
							email: $("#email").val()
						},
						success: function(result) {
							alert(result)
						}
					})
				}else{
					alert("请输入您的邮箱")
				}
					
			})
		</script>
	</body>
</html>
